<div id="content">
    <?php
    $IdCategorie = $_GET['id'];
    $oPDO = new PdoCategorie();

    $categorie = $oPDO->readOne($IdCategorie);
    

    include("./PDO/PdoSexe.php");
    include("./class/Sexe.php");

    $sexe = new PdoSexe();
    $sexe = $sexe->readAll();



    echo "<form id='formulaire' action='index.php?route=categorie&action=traitement_modif' method='post'>";

    echo "<label>Catégorie</label>";
    echo "<input type='text' name='nom' value='" . $categorie->getNomCategorie() . "' /><br />";
    
    echo "<label>Poid Minimum</label>";
    echo "<input type='text' name='min' value='" . $categorie->getMinCategorie() . "' /><br />";
    
    echo "<label>Poid Maximum</label>";
    echo "<input type='text' name='max' value='" . $categorie->getMaxCategorie() . "' /><br />";

       echo "<label>Sexe</label>";
    echo '<select name="IDSEXE" size="1">';
    foreach ($sexe as $unsexe) {if ($unsexe["IDSEXE"] == $categorie->getIdSexe()){
        echo '<option value="' . $unsexe["IDSEXE"] . '" selected="selected">' . $unsexe["INTITULESEXE"] . " " . '</option>';
    }
    else {
        echo '<option value="' . $unsexe["IDSEXE"] . '">' . $unsexe["INTITULESEXE"] . " " . '</option>';
    }}
    echo '</select>' . "<br/>";
    
    echo "<input type='hidden' name='id' value='" . $categorie->getIdCategorie() . "' />";
    echo "<input type='submit'  value='Valider'>";

    echo "</form>";

    ?></div>